import request from "@/utils/request";
// 样品列表
export function sampleList(data) {
  return request({
    url: "/sample/list",
    method: "POST",
    data,
  });
}
// 新增样品单
export function sampleSave(data) {
  return request({
    url: "/sample/save",
    method: "POST",
    data,
  });
}
// 商品日志
export function queryLogList(params) {
  return request({
    url: `/sample/get-sample-log`,
    method: "get",
    params
  });
}
// 商品SPU列表
export function querySpuList(data) {
  return request({
    url: "/v1/goods/spu/product-list",
    method: "POST",
    data,
  });
}

// 商品sku列表
export function querySkuList(data) {
  return request({
    url: "/v1/goods/sku/list",
    method: "POST",
    data,
  });
}
// 编辑调用
export function detailDampleId(id) {
  return request({
    url: `/sample/detail?id=${id}`,
    method: "get",
  });
}
// 确认样品到货
export function sampleArrival(data) {
  return request({
    url: `/sample/sample-arrival`,
    method: "POST",
    data,
  });
}
// 修改样品单
export function samplEdit(data) {
  return request({
    url: `/sample/edit`,
    method: "POST",
    data,
  });
}
//  上传检测结果
export function uploadInspectionReport(data) {
  return request({
    url: `/sample/upload-inspection-report`,
    method: "POST",
    data,
  });
}
//  样品检测报告列表
export function getInspectionReport(data) {
  return request({
    url: `/sample/get-inspection-report`,
    method: "POST",
    data,
  });
}
// 新增图片任务（生成图片任务）
export function imageSave(data) {
  return request({
    // url: "/v1/goods/spu/list",
    url: "/assignment/images/save",
    method: "POST",
    data,
  });
}
// 获取仓库
export function warehouseOpt(data) {
  return request({
    baseURL: window.APP_GETEWAY.wms,
    url: `/api/warehouse-opt`,
    method: "post",
    data,
  });
}

// 获取人员列表
export function organization(data) {
  return request({
    baseURL: window.APP_GETEWAY.auth,
    url: `/tenant/organization`,
    method: "post",
    data,
  });
}

// 分类数据
export function getClassifyOption() {
  return request({
    url: "/base/backend-classification/get-list",
    method: "get",
  });
}

// 分类数据
export function cancelSample(data) {
  return request({
    url: "/sample/cancel-sample",
    method: "post",
    data
  });
}

// 生成采购单
export function createPurchaseOrder(data) {
  return request({
    url: "/sample/create-purchase-order",
    method: "post",
    data
  });
}

// 采购单获取样品单详情
export function getPurchaseDetail(params) {
  return request({
    url: "/sample/get-purchase-detail",
    method: "get",
    params
  });
}


// 点击图片获取图片的展示
export function getSampleImagesDetail(params) {
  return request({
    url: "/sample/images-detail",
    method: "get",
    params
  });
}

// 样品单统计
export function getSampleStatistics(data) {
  return request({
    url: "/v1/sample/sample/list-statistics",
    method: "POST",
    data
  });
}

// 撤回样品单
export function revocationStatus(data) {
  return request({
    url: "/v1/sample/sample/revocation-status",
    method: "POST",
    data
  });
}
